package com.lingshu.core.custom;

import android.app.Application;
import android.content.Context;

/**
 * @author 于定金
 * @version 1.0
 * @Date 2024/1/4 11:47
 * @Description
 */
public abstract class BaseApplication extends Application {
    public static Context context;

    @Override
    public void onCreate() {
        super.onCreate();
        context = getApplicationContext();
        if (getDefaultUncaughtExceptionHandler() == null) {
            Thread.setDefaultUncaughtExceptionHandler(new LocalFileHandler(context));
        } else {
            Thread.setDefaultUncaughtExceptionHandler(getDefaultUncaughtExceptionHandler());
        }
    }

    public abstract BaseExceptionHandler getDefaultUncaughtExceptionHandler();
}
